unit irc_protocol;



interface
function ReadUser(data: string):string;
function ReadHost(data: string):string;
function CleanTXT(data: string):string;

implementation
function ReadUser(data: string):string;
  var
    temp : char;
    user : string;
    count: integer;
  begin
    count := 2;
    repeat
      temp  := data[count];
      count := count + 1;
      user  := user + temp
    until (data[count]='!') or (data[count]='');
    result := user;
  end;
function ReadHost(data: string):string;
  var
    temp : char;
    host : string;
    count: integer;
  begin
    count := 2;
    repeat
      count := count + 1;
    until (data[count]='!');
    count := count + 1;
    repeat
      temp  := data[count];
      host := host + temp;
      count := count + 1;
    until data[count]='';
  result := host;
  end;
function CleanTXT(data: string):string;
  var
    temp : char;
    clean : string;
    count: integer;
  begin
    count := 2;
    repeat
      temp  := data[count];
      clean := clean + temp;
      count := count + 1;
    until data[count]='';
    result := clean;
    end;


end.
